import getEchartLayer from './echartLayer.js';

export function initEchartsLayer(projList) {


  var option = {
    title: {
      show: false,
    },
    series: [
      {
        name: '数据传输示意',
        type: 'lines',
        coordinateSystem: 'arcgis',
        polyline: true,
        zlevel: 1,
        effect: {
          show: true,
          period: 6,
          trailLength: 0.8,
          color: '#fff',
          symbolSize: 3,
        },
        lineStyle: {
          normal: {
            // color: '#a6c84c',
            width: 0,
            // curveness: 0.2,
          },
        },
  
        data: [
          {
            coords: [
              [125.285963, 43.947375],
              [125.285442, 43.946817],
              [125.283852, 43.945152],
              [125.282379, 43.94361],
              [125.284171, 43.943607],
              [125.290733, 43.943575],
              [125.29787, 43.943487],
              [125.300206, 43.943506],
              [125.300426, 43.943532],
              [125.300709, 43.943506],
              [125.300673, 43.943068],
              [125.300444, 43.94003],
              [125.300367, 43.938174],
              [125.300304, 43.937048],
              [125.30021, 43.93583],
              [125.300098, 43.934448],
              [125.300183, 43.934376],
              [125.300188, 43.93412],
              [125.300134, 43.93326],
              [125.300071, 43.931799],
              [125.299977, 43.931718],
              [125.299914, 43.931075],
              [125.299878, 43.930364],
              [125.299756, 43.929436],
              [125.299855, 43.929257],
              [125.299932, 43.92904],
              [125.299959, 43.928796],
              [125.299887, 43.928524],
              [125.299738, 43.928141],
              [125.299662, 43.926504],
              [125.29959, 43.926391],
              [125.299532, 43.925592],
              [125.299438, 43.924027],
              [125.299312, 43.922803],
              [125.29919, 43.921803],
              [125.299029, 43.920502],
              [125.299092, 43.920385],
              [125.299051, 43.920115],
              [125.298899, 43.918719],
              [125.298755, 43.917362],
              [125.298539, 43.915264],
              [125.298422, 43.915147],
              [125.29827, 43.913699],
              [125.297991, 43.911439],
              [125.297861, 43.909825],
              [125.297677, 43.908387],
              [125.297448, 43.906399],
              [125.297151, 43.905286],
              [125.296689, 43.904334],
              [125.296253, 43.903675],
              [125.294483, 43.901073],
              [125.293608, 43.899807],
              [125.293307, 43.899362],
              [125.293172, 43.899268],
              [125.292363, 43.898105],
              [125.291501, 43.896822],
              [125.290616, 43.895487],
              [125.290702, 43.895237],
              [125.290832, 43.895042],
              [125.292327, 43.894461],
              [125.29624, 43.893018],
              [125.298728, 43.89206],
              [125.302456, 43.890569],
              [125.303682, 43.890092],
              [125.303781, 43.889997],
              [125.305272, 43.889448],
              [125.306, 43.889208],
              [125.306534, 43.889156],
              [125.311039, 43.889065],
              [125.311098, 43.885813],
              [125.311124, 43.884004],
              [125.307882, 43.884043],
              [125.30798, 43.881327],
              [125.308052, 43.879634],
              [125.308075, 43.879481],
              [125.308205, 43.879326],
              [125.308856, 43.878874],
              [125.308816, 43.878789],
              [125.308416, 43.878487],
              [125.305847, 43.876713],
              [125.307756, 43.875284],
              [125.310774, 43.872977],
              [125.310702, 43.872934],
              [125.31359, 43.870709],
              [125.313797, 43.870605],
              [125.313972, 43.870585],
              [125.314327, 43.870683],
              [125.31465, 43.870722],
              [125.314978, 43.87066],
              [125.315252, 43.870523],
              [125.315504, 43.870338],
              [125.315629, 43.870147],
              [125.315715, 43.869984],
              [125.328134, 43.869922],
              [125.331938, 43.869919],
              [125.332113, 43.863501],
              [125.331988, 43.863498],
              [125.332024, 43.862533],
              [125.332136, 43.862529],
              [125.332298, 43.857979],
              [125.332351, 43.855031],
              [125.332414, 43.850221],
              [125.32764, 43.850286],
            ],
            lineStyle: {
              normal: {
                color: 'rgba(90,221,223,1)',
              },
            },
          },
        ],
      },
    ],
  };

  getEchartLayer().then(echartsLayer => {
    var chart = new echartsLayer(window.agsGlobal.view, option);
  });
}
